// 存取token

// 存
export const saveToken = data => {
  localStorage.setItem("USERTOKEN", JSON.stringify(data));
};
// 取
export const getToken = () => {
  return JSON.parse(localStorage.getItem("USERTOKEN"));
};

// 删除
export const delToken = () => {
  localStorage.removeItem("USERTOKEN");
};

// 存数据
export const setData = (key, data) => {
  localStorage.setItem(key, JSON.stringify(data));
};
// 取
export const getData = key => {
  return JSON.parse(localStorage.getItem(key));
};
